Method and apparatus for adjusting image luminance, storage medium, and electronic device

ABSTRACT

This application discloses a method for adjusting image luminance performed at an electronic device. The method includes: determining a target pixel with original luminance lower than a luminance threshold in an original image, the luminance threshold being determined according to luminance of pixels in the original image; obtaining a luminance distribution intensity of pixels adjacent to the target pixel; determining a difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels; and adjusting the target pixel to corresponding target luminance according to the difference and the original luminance of the target pixel. According to this application, a changing characteristic of relative luminance between the target pixel and the adjacent pixel is reserved. The luminance adjustment is more consistent with the luminance propagation of the original image, thereby achieving a technical effect of improving an adjustment effect of luminance adjustment on an image.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of PCT Patent ApplicationNo. PCT/CN2020/084581, entitled “METHOD AND APPARATUS FOR ADJUSTINGIMAGE LUMINANCE, STORAGE MEDIUM, AND ELECTRONIC DEVICE” filed on Apr.14, 2020, which claims priority to Chinese Patent Application No.201910368934.3, entitled “METHOD AND APPARATUS FOR ADJUSTING IMAGELUMINANCE, STORAGE MEDIUM, AND ELECTRONIC DEVICE” and filed with theChina National Intellectual Property Administration on May 5, 2019, allof which are incorporated herein by reference in their entirety.

FIELD OF THE TECHNOLOGY

This application relates to the field of computers, and specifically, toa technology for adjusting image luminance.

BACKGROUND OF THE DISCLOSURE

The conventional method for adjusting a dark part of an image is mainlyto perform luminance enhancement on all pixels with luminance less thana luminance threshold in the image, to achieve visibility of details inthe dark part of the entire image. However, such an adjustment methodresults in an important problem, that is, because relative luminancechanges with adjacent pixels are not taken into account, luminance ofpixels of an entire picture will be enhanced as long as the pixelluminance is less than an absolute threshold. Consequently, contrastdetail changes in adjacent pixel areas are sacrificed.

For the foregoing problem, no effective solution has been provided yet.

SUMMARY

Embodiments of this application provide a method and an apparatus foradjusting image luminance, a storage medium, and an electronic device,so that luminance adjustment is more consistent with luminancepropagation of an original image, achieving a technical effect ofimproving an adjustment effect of luminance adjustment on an image.

According to an aspect of the embodiments of this application, a methodfor adjusting image luminance is performed at an electronic device, themethod including:

determining a target pixel with original luminance lower than aluminance threshold in an original image, the luminance threshold beinga threshold determined according to luminance of pixels in the originalimage;

obtaining a luminance distribution intensity of pixels adjacent to thetarget pixel in the original image;

determining a difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels; and

adjusting the target pixel to corresponding target luminance accordingto the difference and the original luminance of the target pixel.

According to another aspect of the embodiments of this application, anapparatus for adjusting image luminance is further provided, including:

a first determining module, configured to determine a target pixel withoriginal luminance lower than a luminance threshold in an originalimage, the luminance threshold being a threshold determined according toluminance of pixels in the original image;

an obtaining module, configured to obtain a luminance distributionintensity of pixels adjacent to the target pixel in the original image;

a second determining module, configured to determine a differencebetween the luminance threshold and the luminance distribution intensityof the adjacent pixels; and

an adjustment module, configured to adjust the target pixel tocorresponding target luminance according to the difference and theoriginal luminance of the target pixel.

In some embodiments, the apparatus further includes:

a cancellation module, configured to cancel luminance adjustment of thetarget pixel when the luminance distribution intensity is higher thanthe luminance threshold.

According to another aspect of the embodiments of this application, anon-transitory computer-readable storage medium is further provided, thestorage medium storing a plurality of computer programs, the computerprograms being configured to perform the method according to any one ofthe foregoing aspects when being executed by a processor of anelectronic device.

According to another aspect of the embodiments of this application, anelectronic device is further provided, including a memory and aprocessor, the memory storing a computer program, the processor beingconfigured to perform the method according to any one of the foregoingaspects by using the computer program.

According to another aspect of the embodiments of this application, acomputer program product including instructions is further provided, thecomputer program product, when run on a computer, causing the computerto perform the method according to any one of the foregoing aspects.

In the embodiments of this application, a target pixel with originalluminance lower than a luminance threshold is determined in an originalimage, the luminance threshold being a threshold determined according toluminance of pixels in the original image; a luminance distributionintensity of pixels adjacent to the target pixel in the original imageis obtained; a difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels is determined;and the target pixel is adjusted to corresponding target luminanceaccording to the difference and the original luminance of the targetpixel. The luminance threshold is determined according to the luminanceof the pixels in the original image, the target pixel with originalluminance lower than the luminance threshold is determined in theoriginal image, and the original luminance of the target pixel isadjusted according to the difference between the luminance threshold andthe luminance distribution intensity. Because the luminance threshold isdynamically determined according to the luminance of the pixels in theoriginal image, the luminance threshold is more consistent withluminance propagation of the pixels in the original image. Throughdynamic luminance adjustment according to the difference between theluminance threshold and the luminance distribution intensity, luminanceof an adjacent pixel can be taken into account for the luminanceadjustment of the target pixel, and a changing characteristic ofrelative luminance between the target pixel and the adjacent pixel isreserved. The luminance adjustment is more consistent with the luminancepropagation of the original image, thereby achieving the technicaleffect of improving an adjustment effect of luminance adjustment on animage.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings described herein are used for providing afurther understanding of this application, and form part of thisapplication. Exemplary embodiments of this application and descriptionsthereof are used for explaining this application, and do not constituteany inappropriate limitation to this application. In the accompanyingdrawings:

FIG. 1 is a schematic diagram of a method for adjusting image luminanceaccording to an embodiment of this application.

FIG. 2 is a schematic diagram of an application environment of a methodfor adjusting image luminance according to an embodiment of thisapplication.

FIG. 3 is a schematic diagram of a method for adjusting image luminanceaccording to an embodiment of this application.

FIG. 4 is a schematic diagram 1 of another method for adjusting imageluminance according to an embodiment of this application.

FIG. 5 is a schematic diagram 2 of another method for adjusting imageluminance according to an embodiment of this application.

FIG. 6 is a schematic diagram 3 of another method for adjusting imageluminance according to an embodiment of this application.

FIG. 7a is a schematic diagram 1 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 7b is a schematic diagram 1 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 8 is a schematic diagram 2 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 9 is a schematic diagram 3 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 10 is a schematic diagram 4 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 11 is a schematic diagram 5 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 12 is a schematic diagram 6 of an apparatus for adjusting imageluminance according to an embodiment of this application.

FIG. 13 is a schematic diagram 1 of an application scenario of a methodfor adjusting image luminance according to an embodiment of thisapplication.

FIG. 14 is a schematic diagram 2 of an application scenario of a methodfor adjusting image luminance according to an embodiment of thisapplication.

FIG. 15 is a schematic diagram of an electronic device according to anembodiment of this application.

DESCRIPTION OF EMBODIMENTS

In order to make a person skilled in the art better understand thesolutions of this application, the following clearly and completelydescribes the technical solutions in the embodiments of this applicationwith reference to the accompanying drawings in the embodiments of thisapplication. Apparently, the described embodiments are only some of theembodiments of this application rather than all of the embodiments. Allother embodiments obtained by a person of ordinary skill in the artbased on the embodiments of this application without creative effortsshall fall within the protection scope of this application.

In this specification, claims, and accompanying drawings of thisapplication, the terms “first”, “second”, and so on are intended todistinguish similar objects but do not necessarily indicate a specificorder or sequence. It is to be understood that the data termed in such away are interchangeable in appropriate circumstances, so that theembodiments of this application described herein can be implemented inorders other than the order illustrated or described herein. Moreover,the terms “include”, “contain”, and any other variants thereof mean tocover the non-exclusive inclusion. For example, a process, method,system, product, or electronic device that includes a list of steps orunits is not necessarily limited to those steps or units that areclearly listed, but may include other steps or units not expresslylisted or inherent to such a process, method, system, product, orelectronic device.

According to an aspect of the embodiments of this application, a methodfor adjusting image luminance is provided. As shown in FIG. 1, themethod includes:

S102. Determine a target pixel with original luminance lower than aluminance threshold in an original image, the luminance threshold beinga threshold determined according to luminance of pixels in the originalimage.

S104. Obtain a luminance distribution intensity of pixels adjacent tothe target pixel in the original image.

S106. Determine a difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels.

S108. Adjust the target pixel to corresponding target luminanceaccording to the difference and the original luminance of the targetpixel.

In some embodiments, the foregoing method for adjusting image luminancemay be applied to a hardware environment formed by a terminal 202 shownin FIG. 2. As shown in FIG. 2, the terminal 202 determines a targetpixel with original luminance lower than a luminance threshold in anoriginal image, the luminance threshold being a threshold determinedaccording to luminance of pixels in the original image; and obtains aluminance distribution intensity of pixels adjacent to the target pixelin the original image. The luminance distribution intensity of theadjacent pixels described herein may reflect luminance of the adjacentpixel of the target pixel. In some embodiments, for a plurality ofadjacent pixels adjacent to the target pixel, the luminance distributionintensity may be a luminance average of the plurality of adjacentpixels, to comprehensively reflect luminance of the adjacent pixels.

A difference between the luminance threshold and the luminancedistribution intensity of the adjacent pixels is determined, and thetarget pixel is adjusted to corresponding target luminance according tothe difference and the original luminance of the target pixel. In someembodiments, the method for adjusting image luminance may be applied to,but not limited to, a scenario in which an image is displayed on aterminal. The terminal may include, but not limited to: a mobile phone,a tablet computer, a personal computer, a smart wearable device, a smarthome device, and the like. The method for adjusting image luminance maybe applied to, but not limited to, a client installed on the terminal.The client may be, but not limited to, various applications, forexample, an on-line education application, an instant messagingapplication, a community space application, a game application, ashopping application, a browser application, a financial application, amultimedia application, and a live broadcast application. Specifically,the method for adjusting image luminance may be applied to, but notlimited to, a scenario in which an image is displayed in a multimediaapplication installed on the foregoing mobile phone, or may be appliedto, but not limited to, a scenario in which an image is displayed in aninstant messaging application installed on the foregoing smart wearabledevice, to improve an adjustment effect when luminance adjustment isperformed on the image. The foregoing description is merely an example,which is not limited in this embodiment.

The foregoing method for adjusting image luminance may be furtherapplied to a server. The server may be configured to provide a luminanceadjustment service for the terminal. By performing the method, theserver may determine the target luminance for luminance adjustment ofthe target pixel, and transmit the target luminance to the terminal, sothat the terminal performs luminance adjustment on the target pixelaccording to the target luminance. The server may be an independentserver, or may be a server in a cluster or a cloud server.

In some embodiments, the adjacent pixel adjacent to the target pixel maybe, but not limited to, a pixel within a predetermined range around thetarget pixel. The predetermined range may be, but not limited to, adistance value, and pixels with distances from the target pixel beingless than the distance value are all determined to be adjacent pixelsadjacent to the target pixel.

In some embodiments, the adjacent pixel adjacent to the target pixel maybe, but not limited to, a point located in a predetermined direction ofthe target pixel. For example, adjacent pixels adjacent to the targetpixel are eight points located above, below, left, right, top left,bottom left, top right, and bottom right of the target pixel.

In some embodiments, the luminance threshold is determined according tothe luminance of the pixels in the original image. In a possibleimplementation, the luminance threshold may be determined according toan average of the luminance of the pixels in the original image. If aluminance average of the pixels in the original image is relativelyhigh, the image itself may be relatively bright, and then a relativelyhigh luminance threshold may be determined. If a luminance average ofthe pixels in the original image is relatively low, the image itself maybe relatively dark, and then a relatively low luminance threshold may bedetermined. By using such a manner of dynamically determining theluminance threshold, luminance adjustment is more flexible and moreconsistent with true contrast of the original image.

In some embodiments, to improve efficiency of luminance adjustment forthe original image, in a possible implementation, the foregoing mannerof determining the difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels in S106 mayinclude:

determining the difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels when theluminance distribution intensity is lower than the luminance threshold.That is, when it is determined that the luminance of the adjacent pixelof the target pixel is relatively low, the difference between theluminance threshold and the luminance distribution intensity of theadjacent pixels may be determined, to perform luminance adjustment onthe target pixel.

In some embodiments, if the luminance distribution intensity is higherthan the luminance threshold, the luminance adjustment may not beperformed on the target pixel, to reserve pixel contrast of the originalimage at the target pixel. For example, after the foregoing step S104,the terminal may cancel luminance adjustment of the target pixel whenthe luminance distribution intensity is higher than the luminancethreshold.

In this manner, luminance adjustment is performed on the target pixelwhen the luminance of the adjacent pixel is relatively low, andluminance adjustment of the target pixel is canceled when the luminanceof the adjacent pixel is relatively high, which can effectively reduce aquantity of pixels for the luminance adjustment, and improve theefficiency of luminance adjustment of the image.

In some embodiments, as shown in FIG. 3, an original image that needs tobe displayed on the terminal is FIG. A, where a luminance average ofpixels in FIG. A is P. A luminance threshold determined by the terminalaccording to the luminance average P is M. The terminal determinestarget pixels with luminance lower than M in FIG. A as a point B and apoint C. The terminal obtains a luminance distribution intensity N of anadjacent pixel adjacent to the point B and a luminance distributionintensity Q of an adjacent pixel adjacent to the point C in FIG. A. Whenthe Luminance propagation intensity N corresponding to the point B islower than M, a difference between M and N is determined, namely M-N,and a target luminance adjustment curve corresponding to M-N isdetermined as S1. Original luminance L of the point B is then adjustedto target luminance L′ shown on the target luminance adjustment curveaccording to the target luminance adjustment curve S1. When theluminance distribution intensity Q corresponding to the point C ishigher than M, luminance adjustment of the point C is canceled.

In this embodiment of this application, the manner of adjusting thetarget pixel to corresponding target luminance according to thedifference and the original luminance of the target pixel in S108 mayinclude:

determining a target luminance adjustment curve corresponding to thedifference. The target luminance adjustment curve may reflect the targetluminance that needs to be adjusted for the target pixel according torelative luminance changes of different target pixels and luminancepropagation intensities of adjacent pixels.

Therefore, the original luminance of the target pixel is then adjustedto the corresponding target luminance according to the target luminanceadjustment curve.

By using this manner of luminance adjustment based on the targetluminance adjustment curve, dynamic luminance adjustment of the targetpixel is implemented.

As can be seen, through the foregoing steps, the luminance threshold isdetermined according to the luminance of the pixels in the originalimage, the target pixel with original luminance lower than the luminancethreshold is determined in the original image, and the originalluminance of the target pixel is adjusted according to the differencebetween the luminance threshold and the luminance distributionintensity. Because the luminance threshold is dynamically determinedaccording to the luminance of the pixels in the original image, theluminance threshold is more consistent with luminance propagation of thepixels in the original image. Through dynamic luminance adjustmentaccording to the difference between the luminance threshold and theluminance distribution intensity, luminance of an n adjacent pixel canbe taken into account for the luminance adjustment of the target pixel,and a changing characteristic of relative luminance between the targetpixel and the adjacent pixel is reserved. The luminance adjustment ismore consistent with the luminance propagation of the original image,thereby achieving the technical effect of improving an adjustment effectof luminance adjustment on an image.

In some embodiments, the determining a target luminance adjustment curvecorresponding to the difference includes:

S11. Determine an adjustment intensity corresponding to the target pixelaccording to the difference, a greater difference indicating a greateradjustment intensity.

S12. Determine the target luminance adjustment curve according to theadjustment intensity and the luminance threshold.

The adjustment intensity may reflect the intensity of luminanceadjustment of the target pixel. A greater adjustment intensity indicateshigher target luminance after the target pixel is adjusted, and asmaller adjustment intensity indicates lower target luminance after thetarget pixel is adjusted.

In some embodiments, a plurality of luminance adjustment curves may bepreset, to determine, according to the adjustment intensity determinedby using the difference and the luminance average of the pixels in theoriginal image, a luminance adjustment curve corresponding to theluminance threshold from the luminance adjustment curves as the targetluminance adjustment curve.

For example, when luminance of a pixel in the image is lower than theluminance threshold, the basis for luminance adjustment may be achievedby a relationship between a luminance distribution intensity of anadjacent pixel around the pixel and the luminance threshold. Srepresents an adjustment intensity of the luminance of the target pixel.The basis is that when the luminance distribution intensity of theadjacent pixels around the target pixel is much lower than a luminancethreshold T, the luminance of the pixel needs to be enhanced a littlemore. Conversely, when the luminance distribution intensity of theadjacent pixels around the target pixel is slightly lower than theluminance threshold T, the luminance of the pixel only needs to beslightly enhanced. By using such a method, it is ensured that when thepixel falls in a large dark area, luminance of the dark area will begreatly enhanced. Conversely, when the pixel falls in a small dark areabut luminance of adjacent pixels is too high, the dark area will only beslightly enhanced to ensure uniqueness of the dark area.

In some embodiments, as shown in FIG. 4, when the luminance of thetarget pixel needs to be adjusted, it is ensured according to theforegoing situational result that an adjusted luminance intensityconverges between a luminance value 0 and the luminance threshold T. Acurvature of the target luminance adjustment curve is adjusted accordingto the foregoing adjustment intensity S. For example, an originalluminance value is 0.15, and according to an impact of differentadjustment intensities S (1.0, 2.0, 3.0), the luminance is enhanced todifferent target luminance (0.165, 0.185, 0.215).

In some embodiments, the adjustment intensity may be, but not limitedto, determined by using the following formula:

S=(T−La)*k,

where S is the adjustment intensity, T is the luminance threshold, La isthe luminance distribution intensity of the adjacent pixels, and k is aconstant factor.

In some embodiments, the target luminance adjustment curve may be, butnot limited to, determined by using the following formula:

L′=Lc+S*sin(PI*Lc/T),

where L′ is the target luminance adjustment curve, Lc is the originalluminance, and PI is a constant π.

In some embodiments, the foregoing luminance adjustment formula does notneed to use a large number of time-consuming mathematical operationfunctions, and the entire mathematical operation logic is very suitablefor directly running on a graphics processing unit (GPU) pipeline (byusing a shader). This may not only be connected with a Mipmap function,but also ensure that overall operating costs are minimized. Requirementsfor computing efficiency and memory usage of the device are relativelylow, so that a high-quality dark part adjustment and rendering mechanismcan be implemented on a smartphone with poor requirements for computingefficiency and memory usage.

In some embodiments, before the determining a target pixel with originalluminance lower than a luminance threshold in an original image, themethod further includes:

S21. Determine the luminance average of the pixels in the original imageby using a Mipmap function of a GPU graphics pipeline.

S22. Determine the luminance threshold according to the luminanceaverage of the pixels in the original image, a greater luminance averageindicating a greater luminance threshold.

In the entire luminance adjustment process, the luminance average of theentire image needs to be taken into account, to dynamically generate theluminance threshold, and the threshold is used to measure which pixelsin the image need luminance adjustment. When luminance of a pixel isadjusted, a luminance distribution intensity of a neighboring pixel ofthe pixel, that is, an adjacent pixel needs to be calculated first, andan intensity of luminance adjustment required is determined by using theluminance distribution intensity. In this part, if a conventional CPU isused for calculations, the pixels of the entire image need to be polledfirst, to calculate the luminance average. When the luminance thresholdis generated from the luminance average, the entire image needs to bepolled again to compare the luminance of the pixel with the luminancethreshold, to further determine pixels whose luminance needs to beadjusted. Secondly, when the luminance of the pixel is adjusted again,luminance of a neighboring pixel of the pixel, that is, the adjacentpixel needs to be polled to calculate the adjacent luminancedistribution intensity as the basis for luminance adjustment of thepixel later. The various calculations are excessively time-consuming,and can hardly meet requirements of dynamically adjusting luminance of adark part for an image with a large screen resolution.

In some embodiments, current smartphones are all equipped with ahigh-performance GPU graphics pipeline architecture. The GPU graphicspipelines are all formulated following the same standard (OpenGL ES).Therefore, if the calculation of the luminance average and the adjacentluminance distribution intensity is implemented by using the GPUgraphics pipeline, not only the calculation time required can be greatlyreduced, but also it can be ensured that this method can run on mostsmartphones.

In some embodiments, there are several ways to calculate the luminanceaverage and the luminance distribution intensity of the neighboringpixel, that is, the adjacent pixel by using the GPU graphics pipeline.For example, a Compute Shader program may be written for thecalculation, or a plurality of times of texture dimensionality reductionrendering is performed for the calculation.

In some embodiments, the luminance average and the luminancedistribution intensity may be determined by using the Mipmap function ofthe GPU graphics pipeline.

In some embodiments, the determining the luminance average of the pixelsin the original image by using a Mipmap function of a GPU graphicspipeline includes:

S31. Generate a first image corresponding to the original image by usingthe Mipmap function, a resolution of the first image being 1×1.

S32. Determine luminance of the first image as the luminance average ofthe pixels in the original image.

In some embodiments, when a Mipmap generation instruction is issued tothe GPU graphics pipeline, the GPU respectively generates images withresolutions lower than that of the original image in a power-of-twoattenuation manner, and the luminance of the first image with theresolution of 1×1 is determined as the luminance average of the pixelsin the original image.

For example, as shown in FIG. 5, a leftmost original image is anoriginal image with a 128×128 resolution. When the Mipmap generationinstruction is issued to the GPU graphics pipeline, the GPU respectivelygenerates reduced images with different resolutions such as 64×64,32×32, 16×16, 8×8, 4×4, 2×2, and 1×1 in the power-of-two attenuationmanner. A color of each pixel in a small image at each order is of acolor value generated by averaging colors of four pixels in acorresponding position of a large image at a previous order. In otherwords, a small image at each order may be regarded as a color averageresult of a large image at a previous order. Through the foregoingprocess, a color value of a pixel in an image with a 1×1 resolution maybe regarded as a color value obtained after colors of all pixels in anoriginal image with a 128×128 resolution are averaged. Because theMipmap function is directly generated by hardware in the GPU graphicspipeline, generation efficiency thereof is very good, and may beregarded as a weapon with almost no additional computing cost.

By using the Mipmap function, an average of all colors of an entirepicture can be obtained from a 1×1 pixel image at a very low cost.Accordingly, a pixel luminance value of the 1×1 image may be used as theluminance threshold to be used as a basis for determining a dark partwhose luminance needs to be adjusted subsequently.

In some embodiments, the obtaining a luminance distribution intensity ofpixels adjacent to the target pixel in the original image includes:

S41. Generate a second image corresponding to the original image byusing a Mipmap function of a GPU graphics pipeline, a resolution of thesecond image being less than a resolution of the original image.

S42. Obtain a first position of the target pixel on the original image.

S43. Determine a second position corresponding to the first position onthe second image.

S44. Determine luminance of a pixel located at the second position onthe second image as the luminance distribution intensity of the adjacentpixels.

In some embodiments, the Mipmap function may be used to accelerate theprocess of calculating the luminance distribution intensity of theadjacent pixels. Assuming that a middle-level low resolution (forexample: 64×64) of a Mipmap is used as a reference, a color luminancevalue of each pixel in an image with the resolution of 64×64 may beregarded as a color luminance average of a block (image width divided by64 and image height divided by 64) in the original image.

In some embodiments, as shown in FIG. 6, when a pixel luminance value ofthe original image is less than the luminance threshold, that is, theluminance needs to be adjusted, the same image coordinate position ofthe image with the 64×64 resolution may be directly queried, forexample, a coordinate position of a target pixel in the original imageis (0.3, 0.5), and luminance of a corresponding pixel at the imagecoordinate position (0.3, 0.5) in the image with the 64×64 resolutionmay be queried. By using an internal difference mechanism of computergraphics texture, average luminance data representing a color of theblock (image width divided by 64 and image height divided by 64)neighboring the pixel in the original image is returned. The averageluminance data may be used as the luminance distribution intensity ofthe neighboring pixel, that is, the adjacent pixel, which is the basisfor adjusting the luminance of the pixel.

For ease of description, the foregoing method embodiments are stated asa combination of a series of action combinations. However, a personskilled in the art is to know that this application is not limited tothe described action sequence, because according to this application,some steps may be performed in another sequence or simultaneously. Inaddition, a person skilled in the art is also to understand that theembodiments described in this specification are all exemplaryembodiments, and the involved actions and modules are not necessarilyrequired to this application.

According to the descriptions in the foregoing implementations, a personskilled in the art may clearly learn that the method according to theforegoing embodiment may be implemented by software plus a necessaryuniversal hardware platform, or by using hardware, but in many cases,the former is a preferred implementation. Based on such anunderstanding, the technical solutions of this application essentiallyor the part contributing to the related art may be implemented in theform of a software product. The computer software product is stored in astorage medium (such as a read-only memory (ROM)/random access memory(RAM), a magnetic disk, or an optical disc), and includes severalinstructions for instructing a terminal device (which may be a mobilephone, a computer, a server, a network device, or the like) to performthe method described in the embodiments of this application.

According to another aspect of the embodiments of this application, anapparatus for adjusting image luminance configured to implement theforegoing method for adjusting image luminance is further provided. Asshown in FIG. 7a , the apparatus includes:

a first determining module 702, configured to determine a target pixelwith original luminance lower than a luminance threshold in an originalimage, the luminance threshold being a threshold determined according toluminance of pixels in the original image;

an obtaining module 704, configured to obtain a luminance distributionintensity of pixels adjacent to the target pixel in the original image;

a second determining module 706, configured to determine a differencebetween the luminance threshold and the luminance distribution intensityof the adjacent pixels; and

an adjustment module 710, configured to adjust the target pixel tocorresponding target luminance according to the difference and theoriginal luminance of the target pixel.

In some embodiments, as shown in FIG. 7b , the apparatus furtherincludes:

a third determining module 708, configured to determine a targetluminance adjustment curve corresponding to the difference; and

the adjustment module 710 being specifically configured to adjust theoriginal luminance of the target pixel to the corresponding targetluminance according to the target luminance adjustment curve.

In some embodiments, the second determining module is specificallyconfigured to:

determine the difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels when theluminance distribution intensity is lower than the luminance threshold.

In some embodiments, the adjacent pixel adjacent to the target pixel maybe, but not limited to, a pixel within a predetermined range around thetarget pixel. The predetermined range may be, but not limited to, adistance value, and pixels with distances from the target pixel beingless than the distance value are all determined to be adjacent pixelsadjacent to the target pixel.

In some embodiments, the adjacent pixel adjacent to the target pixel maybe, but not limited to, a point located in a predetermined direction ofthe target pixel. For example, adjacent pixels adjacent to the targetpixel are eight points located above, below, left, right, top left,bottom left, top right, and bottom right of the target pixel.

In some embodiments, the luminance threshold is determined according tothe luminance of the pixels in the original image. In a possibleimplementation, the luminance threshold may be determined according toan average of the luminance of the pixels in the original image. Forexample, if a luminance average of the pixels in the original image isrelatively high, the image itself may be relatively bright, and then arelatively high luminance threshold may be determined. If a luminanceaverage of the pixels in the original image is relatively low, the imageitself may be relatively dark, and then a relatively low luminancethreshold may be determined. By using such a manner of dynamicallydetermining the luminance threshold, luminance adjustment is moreflexible and more consistent with true contrast of the original image.

By using the foregoing apparatus, the luminance threshold is determinedaccording to the luminance of the pixels in the original image, thetarget pixel with original luminance lower than the luminance thresholdis determined in the original image, and the original luminance of thetarget pixel is adjusted according to the difference between theluminance threshold and the luminance distribution intensity. Becausethe luminance threshold is dynamically determined according to theluminance of the pixels in the original image, the luminance thresholdis more consistent with luminance propagation of the pixels in theoriginal image. Through dynamic luminance adjustment according to thedifference between the luminance threshold and the luminancedistribution intensity, luminance of an adjacent pixel can be taken intoaccount for the luminance adjustment of the target pixel, and a changingcharacteristic of relative luminance between the target pixel and theadjacent pixel is reserved. The luminance adjustment is more consistentwith the luminance propagation of the original image, thereby achievingthe technical effect of improving an adjustment effect of luminanceadjustment on an image.

FIG. 8 is a schematic diagram 2 of an apparatus for adjusting imageluminance according to an embodiment of this application. Optionally,the foregoing apparatus further includes:

a cancellation module 802, configured to cancel luminance adjustment ofthe target pixel when the luminance distribution intensity is higherthan the luminance threshold.

FIG. 9 is a schematic diagram 3 of an apparatus for adjusting imageluminance according to an embodiment of this application. Optionally,the third determining module 708 includes:

a first determining unit 902, configured to determine an adjustmentintensity corresponding to the target pixel according to the difference,a greater difference indicating a greater adjustment intensity; and asecond determining unit 904, configured to determine the targetluminance adjustment curve according to the adjustment intensity and theluminance threshold.

In some embodiments, a plurality of luminance adjustment curves may bepreset, to determine, according to the adjustment intensity determinedby using the difference and the luminance average of the pixels in theoriginal image, a luminance adjustment curve corresponding to theluminance threshold from the luminance adjustment curves as the targetluminance adjustment curve.

Optionally, the first determining unit is configured to determine theadjustment intensity by using the following formula:

S=(T−La)*k,

where S is the adjustment intensity, T is the luminance threshold, La isthe luminance distribution intensity of the adjacent pixels, and k is aconstant factor.

The second determining unit is configured to determine the targetluminance adjustment curve by using the following formula:

L′=Lc+S*sin(PI*Lc/T),

where L′ is the target luminance adjustment curve, Lc is the originalluminance, and PI is a constant π.

FIG. 10 is a schematic diagram 4 of an apparatus for adjusting imageluminance according to an embodiment of this application. Optionally,the foregoing apparatus further includes:

a fourth determining module 1002, configured to determine the luminanceaverage of the pixels in the original image by using a Mipmap functionof a graphics processing unit (GPU) graphics pipeline; and

a fifth determining module 1004, configured to determine the luminancethreshold according to the luminance average of the pixels in theoriginal image, a greater luminance average indicating a greaterluminance threshold.

In some embodiments, current smartphones are all equipped with ahigh-performance GPU graphics pipeline architecture. The GPU graphicspipelines are all formulated following the same standard (OpenGL ES).Therefore, if the calculation of the luminance average and the adjacentluminance distribution intensity is implemented by using the GPUgraphics pipeline, not only the calculation time required can be greatlyreduced, but also it can be ensured that this method can run on mostsmartphones.

In some embodiments, the luminance average and the luminancedistribution intensity may be determined by using the Mipmap function ofthe GPU graphics pipeline.

FIG. 11 is a schematic diagram 5 of an apparatus for adjusting imageluminance according to an embodiment of this application. Optionally,the fourth determining module 1002 includes:

a first generation unit 1102, configured to generate a first imagecorresponding to the original image by using the Mipmap function, aresolution of the first image being 1×1; and

a third determining unit 1104, configured to determine luminance of thefirst image as the luminance average of the pixels in the originalimage.

In some embodiments, when a Mipmap generation instruction is issued tothe GPU graphics pipeline, the GPU respectively generates images withresolutions lower than that of the original image in a power-of-twoattenuation manner, and the luminance of the first image with theresolution of 1×1 is determined as the luminance average of the pixelsin the original image.

FIG. 12 is a schematic diagram 6 of an apparatus for adjusting imageluminance according to an embodiment of this application. Optionally,the obtaining module 704 includes:

a second generation unit 1202, configured to generate a second imagecorresponding to the original image by using a Mipmap function of a GPUgraphics pipeline, a resolution of the second image being less than aresolution of the original image;

an obtaining unit 1204, configured to obtain a first position of thetarget pixel on the original image;

a fourth determining unit 1206, configured to determine a secondposition corresponding to the first position on the second image; and

a fifth determining unit 1208, configured to determine luminance of apixel located at the second position on the second image as theluminance distribution intensity of the adjacent pixels.

In some embodiments, the Mipmap function may be used to accelerate theprocess of calculating the luminance distribution intensity of theadjacent pixels. Assuming that a middle-level low resolution (forexample: 64×64) of a Mipmap is used as a reference, a color luminancevalue of each pixel in an image with the resolution of 64×64 may beregarded as a color luminance average of a block (image width divided by64 and image height divided by 64) in the original image.

In this application, the term “unit” or “module” refers to a computerprogram or part of the computer program that has a predefined functionand works together with other related parts to achieve a predefined goaland may be all or partially implemented by using software, hardware(e.g., processing circuitry and/or memory configured to perform thepredefined functions), or a combination thereof. Each unit or module canbe implemented using one or more processors (or processors and memory).Likewise, a processor (or processors and memory) can be used toimplement one or more modules or units. Moreover, each module or unitcan be part of an overall module that includes the functionalities ofthe module or unit. For an application environment of this embodiment ofthis application, reference may be made but is not limited to theapplication environment of the foregoing embodiment. This is notdescribed in detail in this embodiment. This embodiment of thisapplication provides an optional specific application example forimplementing the foregoing object display method.

In some embodiments, the foregoing method for adjusting image luminancemay be applied to, but not limited to, a scenario in which an image isdisplayed on a terminal as shown in FIG. 13. In this scenario, a systemfor adjusting image luminance is provided. The system includes thefollowing modules:

A luminance propagation map generator module is included, where themeaning of luminance propagation map is to record a luminancedistribution intensity of another pixel around a pixel in an image,which is used to determine a curvature of a target luminance adjustmentcurve when luminance of the pixel needs to be enhanced. The image may bedirectly represented by a small image at an order with a low resolutionin the Mipmap.

The meaning of luminance average map is an average luminance result ofan entire picture. The image may be directly represented by a smallimage with a lowest resolution 1×1 in the Mipmap.

A function of the luminance propagation map generator module is mainlyto generate a luminance propagation map and a luminance average map.According to the previous explanation, the entire module function can beobtained only by calling the Mipmap function of the GPU graphicspipeline, and then selecting a small image at an order of a relativelylow resolution and the small image with the 1×1 resolution. Because theentire module uses the Mipmap function, computing costs required overallare greatly reduced.

A dark-threshold generator module is included. The dark-threshold is aluminance threshold, and is used to determine whether a pixel in animage needs luminance adjustment. Because the luminance threshold isbased on a luminance average of the entire image, the result of theimage with the 1×1 resolution in the Mipmap generated by the luminancepropagation map generator in the previous step may be directly usedwithout an additional computing cost.

A luminance curve adjustor module is included, and is a curve generatormodule configured to adjust luminance of a pixel. The module is mainlyconfigured to generate, according to a difference between a luminancedistribution intensity around a pixel and a luminance threshold, atarget luminance adjustment curve consistent with a curvature of thedifference, and determine target luminance through the curve. Amathematical formula of the curve generator is a combination ofextremely low-cost mathematical expressions as shown previously. Inaddition, the curve generation process may be integrated into thefragment shader in the GPU graphics pipeline together with thesubsequent processing of whether to perform pixel adjustment. By using amulti-threaded synchronization processing mechanism in the GPU, the costof the entire calculation becomes very low, which ensures effectiveoperation of a dark part adjustment mechanism.

In some embodiments, as shown in FIG. 14, the luminance propagation mapmodule generates, from the original image and by using the Mipmapfunction, a luminance propagation map representing a luminancedistribution intensity around each pixel and an overall luminanceaverage map with a 1×1 resolution.

Each pixel in the image runs the fragment shader in the GPU graphicspipeline, where a luminance average of the entire image is obtained fromthe luminance average map with a 1×1 resolution, and a luminancethreshold is generated via the dark-threshold generator. Each pixel inthe image queries the luminance propagation map to obtain the luminancedistribution intensity around the pixel. The luminance distributionintensity around the pixel is compared with the luminance threshold. Ifthe luminance distribution intensity around the pixel is higher than theluminance threshold, no luminance adjustment is performed. If theluminance distribution intensity around the pixel is lower than theluminance threshold, a difference between the luminance distributionintensity around the pixel and the luminance threshold is calculated.The luminance difference passes through the luminance curve adjustor toobtain a query curve consistent with the difference. Then the curve isused to determine and adjust the target luminance of the pixel.

By using the foregoing method, a mechanism of a necessary GPU graphicspipeline process in a smartphone may be used to implement a regionaldynamic image luminance enhancement technology that originally requiresa lot of computing costs and system resources to be implemented. Becausethis method is implemented purely through a necessary GPU graphicspipeline unit in the hardware, the method can run on most smartphoneproducts on the market. As the performance of mobile phones is optimizedyear by year, the performance of GPU graphics pipeline units is updatedyear by year, form which this technology can benefit, to reduce morecomputing performance costs.

According to still another aspect of the embodiments of thisapplication, an electronic device configured to perform the foregoingmethod for adjusting image luminance is further provided. As shown inFIG. 15, the electronic device includes: one or more (only one is shownin the figure) processors 1502, a memory 1504, a sensor 1506, an encoder1508, and a transmission apparatus 1510. The memory stores a computerprogram, and the processor is configured to perform, by using thecomputer program, the steps in any one of the foregoing methodembodiments.

In some embodiments, the electronic device may be located in at leastone of a plurality of network electronic devices of a computer network.

In some embodiments, the processor may be configured to perform thefollowing steps by using a computer program:

S51. Determine a target pixel with original luminance lower than aluminance threshold in an original image, the luminance threshold beinga threshold determined according to luminance of pixels in the originalimage.

S52. Obtain a luminance distribution intensity of pixels adjacent to thetarget pixel in the original image.

S53. Determine a difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels.

S54. Adjust the target pixel to corresponding target luminance accordingto the difference and the original luminance of the target pixel.

Optionally, a person of ordinary skill in the art may understand that,the structure shown in FIG. 15 is only illustrative. The electronicdevice may be alternatively a terminal device such as a smartphone (forexample, an Android mobile phone or an iOS mobile phone), a tabletcomputer, a palmtop computer, a mobile Internet device (MID), or a PAD.FIG. 15 does not constitute a limitation on a structure of the foregoingelectronic device. For example, the electronic device may alternativelyinclude more or fewer components (such as a network interface and adisplay device) than those shown in FIG. 15, or has a configurationdifferent from that shown in FIG. 15.

The memory 1504 may be configured to store a software program andmodule, for example, a program instruction/module corresponding to themethod and apparatus for adjusting image luminance in the embodiments ofthis application. The processor 1502 runs the software program andmodule stored in the memory 1504, to perform various functionalapplication and data processing, that is, implement the foregoing targetcomponent and control method. The memory 1504 may include a high-speedrandom access memory, and may also include a non-volatile memory, forexample, one or more magnetic storage apparatuses, a flash memory, oranother non-volatile solid-state memory. In some embodiments, the memory1504 may further include memories remotely disposed relative to theprocessor 1502, and the remote memories may be connected to a terminalby using a network. Examples of the network include, but not limited to,the Internet, an intranet, a local area network, a mobile communicationnetwork, and a combination thereof.

The transmission apparatus 1510 is configured to receive or transmitdata by using a network. Specific examples of the foregoing network mayinclude a wired network and a wireless network. In an example, thetransmission apparatus 1510 includes a network interface controller(NIC). The NIC may be connected to another network device and a routerby using a network cable, to communicate with the Internet or a localarea network. In an example, the transmission apparatus 1510 is a radiofrequency (RF) module, which communicates with the Internet in awireless manner.

Specifically, the memory 1504 is configured to store an application.

An embodiment of this application further provides a storage medium,storing a computer program, the computer program being configured toperform steps in any one of the foregoing method embodiments when beingrun.

In some embodiments, the storage medium may be configured to store acomputer program for performing the following steps:

S61. Determine a target pixel with original luminance lower than aluminance threshold in an original image, the luminance threshold beinga threshold determined according to luminance of pixels in the originalimage.

S62. Obtain a luminance distribution intensity of pixels adjacent to thetarget pixel in the original image.

S63. Determine a difference between the luminance threshold and theluminance distribution intensity of the adjacent pixels.

S64. Adjust the target pixel to corresponding target luminance accordingto the difference and the original luminance of the target pixel.

Optionally, the storage medium is further configured to store a computerprogram used for performing the steps included in the methods accordingto the foregoing embodiments, and details are not described again inthis embodiment.

In some embodiments, a person of ordinary skill in the art mayunderstand that all or some of the steps of the methods in the foregoingembodiments may be implemented by a program instructing relevanthardware of the terminal device. The program may be stored in acomputer-readable storage medium, and the storage medium may include aflash disk, a read-only memory (ROM), a random access memory (RAM), amagnetic disk, an optical disc, or the like.

An embodiment of this application further provides a computer programproduct including instructions, the computer program product, when runon a computer, causing the computer to perform the method according toany one of the foregoing aspects.

The sequence numbers of the foregoing embodiments of this applicationare merely for description purposes, and are not intended to indicatethe preference among the embodiments.

When the integrated unit in the foregoing embodiments is implemented ina form of a software functional unit and sold or used as an independentproduct, the integrated unit may be stored in the foregoingcomputer-readable storage medium. Based on such an understanding, thetechnical solutions of this application essentially, or the partcontributing to the related art, or all or some of the technicalsolutions may be implemented in a form of a software product. Thecomputer software product is stored in a storage medium and includesseveral instructions for instructing one or more computer devices (whichmay be a personal computer, a server, a network device, and the like) toperform all or some of the steps of the methods described in theembodiments of this application.

In the foregoing embodiments of this application, descriptions of theembodiments have respective focuses. As for parts that are not describedin detail in one embodiment, reference may be made to the relevantdescriptions of the other embodiments.

In the several embodiments provided in this application, it is to beunderstood that, the disclosed client may be implemented in anothermanner. The apparatus embodiments described above are merely exemplary.For example, the unit division is merely logical function division andmay be other division in actual implementation. For example, a pluralityof units or components may be combined or integrated into anothersystem, or some features may be ignored or not performed. In addition,the displayed or discussed mutual couplings or direct couplings orcommunication connections may be implemented through some interfaces.The indirect couplings or communication connections between the units ormodules may be implemented in electrical or other forms.

The units described as separate components may or may not be physicallyseparated, and the components displayed as units may or may not bephysical units, and may be located in one place or may be distributed ona plurality of network units. Some or all of the units may be selectedaccording to actual requirements to achieve the objectives of thesolutions of the embodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units may be integrated into one unit.The integrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software functional unit.

The foregoing descriptions are merely exemplary implementations of thisapplication. A person of ordinary skill in the art may further makeseveral improvements and modifications without departing from theprinciple of this application, and the improvements and modificationsare also considered as falling within the protection scope of thisapplication.

What is claimed is:
 1. A method for adjusting image luminance performed at an electronic device, the method comprising: determining a target pixel with original luminance lower than a luminance threshold in an original image, the luminance threshold being a threshold determined according to luminance of pixels in the original image; obtaining a luminance distribution intensity of pixels adjacent to the target pixel in the original image; determining a difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels; and adjusting the target pixel to corresponding target luminance according to the difference and the original luminance of the target pixel.
 2. The method according to claim 1, wherein the adjusting the target pixel to corresponding target luminance according to the difference and the original luminance of the target pixel comprises: determining a target luminance adjustment curve corresponding to the difference; and adjusting the original luminance of the target pixel to the corresponding target luminance according to the target luminance adjustment curve.
 3. The method according to claim 1, wherein the determining a difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels comprises: determining the difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels when the luminance distribution intensity is lower than the luminance threshold.
 4. The method according to claim 3, wherein the method further comprises: after obtaining the luminance distribution intensity of pixels adjacent to the target pixel in the original image, canceling luminance adjustment of the target pixel when the luminance distribution intensity is higher than the luminance threshold.
 5. The method according to claim 2, wherein the determining a target luminance adjustment curve corresponding to the difference comprises: determining an adjustment intensity corresponding to the target pixel according to the difference, a greater difference indicating a greater adjustment intensity; and determining the target luminance adjustment curve according to the adjustment intensity and the luminance threshold.
 6. The method according to claim 5, wherein the determining an adjustment intensity corresponding to the target pixel according to the difference comprises: determining the adjustment intensity by using the following formula: S=(T−La)*k, wherein S is the adjustment intensity, T is the luminance threshold, La is the luminance distribution intensity of the adjacent pixels, and k is a constant factor; and the determining the target luminance adjustment curve according to the adjustment intensity and the luminance threshold comprises: determining the target luminance adjustment curve by using the following formula: L′=Lc+S*sin(PI*Lc/T), wherein L′ is the target luminance adjustment curve, Lc is the original luminance, and PI is a constant π.
 7. The method according to claim 1, wherein the luminance threshold is a threshold determined according to a luminance average of the pixels in the original image.
 8. The method according to claim 7, wherein the method further comprises: before determining the target pixel with original luminance lower than a luminance threshold in an original image, determining the luminance average of the pixels in the original image by using a Mipmap function of a graphics processing unit (GPU) graphics pipeline; and determining the luminance threshold according to the luminance average of the pixels in the original image, a greater luminance average indicating a greater luminance threshold.
 9. The method according to claim 8, wherein the determining the luminance average of the pixels in the original image by using a Mipmap function of a graphics processing unit (GPU) graphics pipeline comprises: generating a first image corresponding to the original image by using the Mipmap function, a resolution of the first image being 1×1; and determining luminance of the first image as the luminance average of the pixels in the original image.
 10. The method according to claim 1, wherein the obtaining a luminance distribution intensity of pixels adjacent to the target pixel in the original image comprises: generating a second image corresponding to the original image by using a Mipmap function of a GPU graphics pipeline, a resolution of the second image being less than a resolution of the original image; obtaining a first position of the target pixel on the original image; determining a second position corresponding to the first position on the second image; and determining luminance of a pixel located at the second position on the second image as the luminance distribution intensity of the adjacent pixels.
 11. An electronic device, comprising a memory and a processor, the memory storing a plurality of computer programs that, when executed by the processor, cause the electronic device to perform a plurality of operations including: determining a target pixel with original luminance lower than a luminance threshold in an original image, the luminance threshold being a threshold determined according to luminance of pixels in the original image; obtaining a luminance distribution intensity of pixels adjacent to the target pixel in the original image; determining a difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels; and adjusting the target pixel to corresponding target luminance according to the difference and the original luminance of the target pixel.
 12. The electronic device according to claim 11, wherein the adjusting the target pixel to corresponding target luminance according to the difference and the original luminance of the target pixel comprises: determining a target luminance adjustment curve corresponding to the difference; and adjusting the original luminance of the target pixel to the corresponding target luminance according to the target luminance adjustment curve.
 13. The electronic device according to claim 11, wherein the determining a difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels comprises: determining the difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels when the luminance distribution intensity is lower than the luminance threshold.
 14. The electronic device according to claim 13, wherein the plurality of operations further comprise: after obtaining the luminance distribution intensity of pixels adjacent to the target pixel in the original image, canceling luminance adjustment of the target pixel when the luminance distribution intensity is higher than the luminance threshold.
 15. The electronic device according to claim 12, wherein the determining a target luminance adjustment curve corresponding to the difference comprises: determining an adjustment intensity corresponding to the target pixel according to the difference, a greater difference indicating a greater adjustment intensity; and determining the target luminance adjustment curve according to the adjustment intensity and the luminance threshold.
 16. The electronic device according to claim 11, wherein the luminance threshold is a threshold determined according to a luminance average of the pixels in the original image.
 17. The electronic device according to claim 16, wherein the plurality of operations further comprise: before determining the target pixel with original luminance lower than a luminance threshold in an original image, determining the luminance average of the pixels in the original image by using a Mipmap function of a graphics processing unit (GPU) graphics pipeline; and determining the luminance threshold according to the luminance average of the pixels in the original image, a greater luminance average indicating a greater luminance threshold.
 18. The electronic device according to claim 11, wherein the obtaining a luminance distribution intensity of pixels adjacent to the target pixel in the original image comprises: generating a second image corresponding to the original image by using a Mipmap function of a GPU graphics pipeline, a resolution of the second image being less than a resolution of the original image; obtaining a first position of the target pixel on the original image; determining a second position corresponding to the first position on the second image; and determining luminance of a pixel located at the second position on the second image as the luminance distribution intensity of the adjacent pixels.
 19. A non-transitory computer-readable storage medium, storing a plurality of computer programs that, when executed by a processor of an electronic device, cause the electronic device to perform a plurality of operations including: determining a target pixel with original luminance lower than a luminance threshold in an original image, the luminance threshold being a threshold determined according to luminance of pixels in the original image; obtaining a luminance distribution intensity of pixels adjacent to the target pixel in the original image; determining a difference between the luminance threshold and the luminance distribution intensity of the adjacent pixels; and adjusting the target pixel to corresponding target luminance according to the difference and the original luminance of the target pixel.
 20. The non-transitory computer-readable storage medium according to claim 19, wherein the obtaining a luminance distribution intensity of pixels adjacent to the target pixel in the original image comprises: generating a second image corresponding to the original image by using a Mipmap function of a GPU graphics pipeline, a resolution of the second image being less than a resolution of the original image; obtaining a first position of the target pixel on the original image; determining a second position corresponding to the first position on the second image; and determining luminance of a pixel located at the second position on the second image as the luminance distribution intensity of the adjacent pixels. 